﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Data;
using System.ComponentModel;

namespace EIA.SLClient.ProjectManage
{
	public class LoadingViewModel : SimpleMvvmToolkit.ViewModelBase<LoadingViewModel>
	{
		public LoadingViewModel()
		{
            RegisterToReceiveMessages<bool>(EIA.SLClient.ProjectManage.Infrastructure.MessageTokens.BUSY_STATE, EP_BusyState);
            IsBusy = true;
            WaitMessage = "初始化...";
		}
        private void EP_BusyState(object sender, SimpleMvvmToolkit.NotificationEventArgs<bool> e)
        {
            IsBusy = e.Data;
            WaitMessage = e.Message;
        }

        protected bool _IsBusy;
        /// <summary>
        /// 注释
        /// </summary>
        public bool IsBusy
        {
            get { return _IsBusy; }
            set
            {
                _IsBusy = value;
                NotifyPropertyChanged(m => m.IsBusy);
            }
        }

        protected string _WaitMessage;
        /// <summary>
        /// 注释
        /// </summary>
        public string WaitMessage
        {
            get { return _WaitMessage; }
            set
            {
                _WaitMessage = value;
                NotifyPropertyChanged(m => m.WaitMessage);
            }
        }


	}
}